<template>
	<view class="container">
		<view class="container-view" v-if="!viewData.success">
			<text class="inner-text">error inner text</text>
		</view>
		<slot v-else></slot>
	</view>
</template>

<script>
	export default {
		props: {
			viewData: {
				type: Object,
				default: function() {
					return {
						success: 1
					}
				}
			}
		},
		data() {
			return {

			};
		}
	}
</script>

<style lang="scss">
	.container {
		position: absolute;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		display: flex;
	}
	/* 这个样式不生效，审核元素中没有这个样式 */
	.container-view {
		background-color: green;
	}

	.inner-text {
		color: red;
		font-size: 36rpx;
	}
</style>
